/*
 * OpenGL.java  0.4.0 / Oct 23, 2010
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
package com.cute4j.opengl;

import com.cute4j.swing.Swing;

/**
 * OpenGL support.
 * <br>
 * <br>
 * <em>NOTE: The OpenGL API will be changed in the future version.
 *           This is just proof of the concept.</em>
 *
 * @cute4j.native
 *    generate="header"
 *
 * @author Slobodan Vrkacevic
 * @version 0.4.0
 */
public final class OpenGL {

// Public Static Fields. -------------------------------------------------------

  /**
   * <tt>True</tt> if the OpenGL is supported on the current platform.
   */
  public static final boolean SUPPORTED;

// Static Initialization. ------------------------------------------------------

  static {
    Swing.initialize();
    SUPPORTED = _initialize();
  }

// Private Constructor. --------------------------------------------------------

 /**
  * Class has no instances.
  */
  private OpenGL() {
    // empty constructor body
  }

// Package-Private Static Native Methods. --------------------------------------

  static native void _glVertex3f(float x, float y, float z);

  static native void _glColor3f(float r, float g, float b);

  static native void _glClearColor(float r, float g, float b, float a);

  static native void _glShadeModel(int mode);

  static native void _glClearDepth(float depth);

  static native void _glHint(int target, int mode);

  static native void _glEnable(int cap);

  static native void _glDepthFunc(int func);

  static native void _glClear(int mask);

  static native void _glLoadIdentity();

  static native void _glTranslatef(float x, float y, float z);

  static native void _glRotatef(float angle, float x, float y, float z);

  static native void _glBegin(int mode);

  static native void _glEnd();

  static native void _glViewport(int x, int y, int width, int height);

  static native void _glMatrixMode(int mode);

  static native void _gluPerspective(double fovy, double aspect, double zNear,
                                     double zFar);

// Private Static Native Methods. ----------------------------------------------

  private static native boolean _initialize();

}
